﻿using System;
using System.Collections.Generic;

namespace Communication.Channel
{
    // Token: 0x02000016 RID: 22
    public class DefaultChannelConfig : ChannelConfig
    {
        // Token: 0x060000E5 RID: 229 RVA: 0x000031F3 File Offset: 0x000013F3
        public virtual bool SetOption(string name, object value)
        {
            if ("connectTimeoutMillis".Equals(name))
            {
                this.SetConnectTimeoutMillis((int)value);
                return true;
            }
            return false;
        }
        /// <summary>
        /// 设置配置(串口基础)
        /// </summary>
        /// <param name="options"></param>
        /// <exception cref="ArgumentNullException"></exception>
        public void SetOptions(IDictionary<string, object> options)
        {
            if (options == null)
            {
                throw new ArgumentNullException();
            }
            foreach (string text in options.Keys)
            {
                this.SetOption(text, options[text]);
            }
        }

        // Token: 0x060000E7 RID: 231 RVA: 0x00003274 File Offset: 0x00001474
        public void SetConnectTimeoutMillis(int connectTimeoutMillis)
        {
            if (connectTimeoutMillis < 0)
            {
                throw new ArgumentException();
            }
            this.connectTimeoutMillis = connectTimeoutMillis;
        }

        // Token: 0x060000E8 RID: 232 RVA: 0x00003287 File Offset: 0x00001487
        public int GetConnectTimeoutMillis()
        {
            return this.connectTimeoutMillis;
        }

        // Token: 0x04000019 RID: 25
        private int connectTimeoutMillis;
    }
}
